fix: validate projection engineVersion and V2 trackEmittedStreams combo#390
fix: validate projection engineVersion and V2 trackEmittedStreams combo#390
Conversation
Reject engineVersion values outside the documented set (0/1/2) and the V2 + trackEmittedStreams combination before sending the request.
Review Summary by QodoValidate projection engineVersion and V2 trackEmittedStreams combination
WalkthroughsDescription• Validate engineVersion parameter accepts only 0, 1, or 2 • Reject invalid engineVersion == 2 && trackEmittedStreams combination • Throw IllegalArgumentException locally instead of server-side error • Improve error messages for invalid projection configurations Diagramflowchart LR
A["CreateProjectionOptions.engineVersion"] -->|validates value| B["0, 1, or 2 only"]
B -->|throws| C["IllegalArgumentException"]
D["CreateProjection.execute"] -->|checks| E["engineVersion == 2 && trackEmittedStreams"]
E -->|throws| C
C -->|local validation| F["Prevents server-side error"]
File Changes1. src/main/java/io/kurrent/dbclient/CreateProjectionOptions.java
|
Code Review by Qodo
1.
|
Match how server-side failures of the same condition surface; keep the public CompletableFuture API free of synchronous throws.
Follow-up to #389.
Summary
engineVersionvalues outside0/1/2inCreateProjectionOptions.engineVersion.engineVersion == 2 && trackEmittedStreamsinCreateProjection.execute()before building the request.Callers now get an
IllegalArgumentExceptionlocally instead of a server-side error for documented-invalid inputs.